import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/home/home.vue'
import Index from '@/views/home/index.vue'
import Cla from '@/views/home/cla.vue'
import Cart from '@/views/home/cart.vue'
import My from '@/views/home/my.vue'
import goods from '@/views/goods/index.vue'
import detail from '@/views/detail/index.vue'
import order from '@/views/order/index.vue'
import chenggong from '@/views/chenggong/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path:'/',redirect:'/home/index'},
    {path: '/home',component: HomeView,children:[
      {path:'index',component:Index},
      {path:'cla',component:Cla},
      {path:'cart',component:Cart},
      {path:'my',component:My},
    ]},
    {path:'/goods/:query',component:goods},
    {path:'/detail/:goods_id',component:detail},
    {path:'/order',component:order},
    {path:'/chenggong',component:chenggong},
  ],
})

export default router
